package com.flyco.modules.job.channel;



import com.flyco.modules.job.order.OrderSettingJob;
import com.flyco.modules.stm.service.IStmChannelPriceService;
import com.flyco.modules.stm.service.IStmChannelProductService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
@Slf4j
public class ChannelPriceJob {

    private Logger logger = LoggerFactory.getLogger(OrderSettingJob.class);

    @Autowired
    private IStmChannelProductService stmChannelProductService;
    @Autowired
    private IStmChannelPriceService stmChannelProductJdService;

//    @XxlJob("channelPriceJobHandler")
//    @Deprecated
//    public ReturnT<String> channelPriceJobHandler(String param) throws Exception {
//
//        logger.info("channelPriceJobHandler 开始运行");
//
//        stmChannelProductService.setChannelProductStatus();
//
//        logger.info("channelPriceJobHandler 运行");
//
//        return ReturnT.SUCCESS;
//    }

    //@XxlJob("channelPriceJobHandlerForJD")
    public ReturnT<String> channelPriceJobHandlerForJD(String param) throws Exception {

        logger.info("channelPriceJobHandlerForJD 开始运行");

        stmChannelProductJdService.setChannelPrice();

        logger.info("channelPriceJobHandlerForJD 运行");

        return ReturnT.SUCCESS;
    }
}
